package org.csz.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.csz.service.OrderService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@Slf4j
@Api(tags = "订单管理")
@RequestMapping("/order")
public class OrderController {

	@Resource
	private OrderService orderService;

	@ApiOperation("添加订单")
	@PostMapping(value = "/add/")
	public void addOrder() {
		orderService.addOrder();
	}

	@ApiOperation("获取订单")
	@RequestMapping(value = "/get/{id}", method = RequestMethod.GET)
	public String getOrderById(@PathVariable("id") String orderId) {
		return orderService.getOrderById(orderId);
	}
}
